package com.kstudio.videocapture.listfile.fileaction;


public class KFileActionItem {
    public static final int FOLDERUP    = 0x0001;
    public static final int FOLDER      = 0x0002;

    private static final char separatorChar = System.getProperty("file.separator", "/").charAt(0);;
    private static final String separator = String.valueOf(separatorChar);

    private String path;
    private int filetype;

    public KFileActionItem(String path, int filetype) {
        this.path = path;
        this.filetype = filetype;
    }

    /* set function */
    public void setFileType(int attribute) {
        this.filetype = attribute;
    }

    /* get function */
    public String getPath() {
        return path;
    }

    public String getName() {
        int separatorIndex = path.lastIndexOf(separator);
        return (separatorIndex < 0) ? path : path.substring(separatorIndex + 1, path.length());
    }

    public int getFileType() {
        return filetype;
    }
}
